<template>
  <div>
    <van-popup round v-model="show_sub_add" @close="close_pop">
      <add_form ref="sub_form" :shoper="shoper" :franchisee_type="franchisee_type" :type="type" @change_date="close" :franchisee_id="shoper ? shoper.id : ''" />
    </van-popup>
  </div>
</template>

<script>
  import add_form from './add_form.vue'
  export default {
    name: "outSky",
    props: {
      show_add: Boolean,
      type: String,
      shoper: Object,
      franchisee_type: String, // 加盟商或是加盟车 car or 
    },
    mounted() {
      console.log(this.show_add);
      console.log(this.type);
      if (this.type == 'add') {

        this.$refs.sub_form.emptyData();
      }
    },

    components: {
      add_form,
    },

    computed: {

      show_sub_add: {
        get() {
          return this.show_add
        },
        set(value) {
          console.log(value);
          if (!value) {
            this.close_pop();
          }
        }
      }
    },
    methods: {
      close() {

        this.show_sub_add = false;
      },
      close_pop() {

        this.$emit('update:show_add', false);
      }
    },
  }
</script>

<style lang="less" scoped>
  /deep/ .van-popup {
    width: 80%;
  }
</style>